<style lang="less">
  .padding {
    box-sizing: border-box;
    padding: 0px 30px;
  }
  .auth_container{
    @import '../assets/less/nav.less';
  }
</style>

<template>
  <div class="auth_container">
    <div class="nav">
      <div class="left">
        <van-icon name="arrow-left" @click="bindNavigateBack"></van-icon>
      </div>
      <div>获取授权</div>
      <div class="user">
        <!-- <van-icon name="manager"></van-icon> -->
      </div>
    </div>
    <van-button type="primary" size="large" @click="bindAuth">授权</van-button>
  </div>
</template>

<script>
  import {
    Dialog, Button, Icon
  } from 'vant';
  import wx from 'weixin-js-sdk'
  export default {
    name: "list",
    components: {
      [Dialog.name]: Dialog,
      [Button.name]: Button,
      [Icon.name]: Icon
    },
    data: function() {
      return {
      }
    },
    methods: {
      bindNavigateBack: function(e) {
        this.$router.go(-1);
      },
      bindAuth: function(){
        let redirect_uri = 'http://127.0.0.1:8081/#/auth'
        location.href = "https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxa7a445db9eba266c&redirect_uri="+ encodeURIComponent(redirect_uri) +"&response_type=code&scope=snsapi_base&state=STATE#wechat_redirect"
      },
      __getAuthConfirm() {
        Dialog.alert({
          title: '标题',
          message: '弹窗内容'
        }).then(() => {
          // on close
        });
        Dialog.alert({
          message: '弹窗内容'
        }).then(() => {
          // on close
        });
      }
    },
    created() {
      
    }
  };
</script>